<template>
  <div class="Showcase1">
    <div class="Showcase1-top">
      <div
        class="titile-box"
        v-for="(item, index) in props.list"
        :key="index"
        :style="{ left: `${ShowcaseItemTransform(item.x ? item.x : getParentX(Number(index)), item.width, 1.833)}rem` }"
      >
        <p>{{ item.name }}</p>
      </div>
      <img
        class="Showcase1-top-left"
        :src="publicUrls + 'free/style16/Showcase2Topleft.webp'"
        alt=""
      />
      <img
        class="Showcase1-top-center"
        :src="publicUrls + 'free/style16/Showcase2TopCenter.webp'"
        alt=""
      />
      <img
        class="Showcase1-top-right"
        :src="publicUrls + 'free/style16/Showcase2TopRight.webp'"
        alt=""
      />
    </div>
    <div class="Showcase1-btm">
      <div class="Showcase1-btm-left"></div>
      <div class="Showcase1-btm-center"></div>
      <div class="Showcase1-btm-right"></div>
    </div>
  </div>
</template>   

<script lang="ts">
export default defineComponent({
  name: 'free16Style2',
});
</script>
  
<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import { defineComponent } from 'vue';
import { ShowcaseItemTransform } from '@/utils/setmaterialStyle';
const props = defineProps({
  list: {
    type: Object,
  },
});
const getParentX = (indexs: number) => {
  let x = 0;
  for (let index = 0; index < indexs; index++) {
    // const element = array[index];
    x = x + props.list[index].width;
  }
  return x + 0.1;
};
</script>  

<style scoped lang="less">
.Showcase1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
}
.Showcase1-top {
  width: 100%;
  height: 194px;
  display: flex;
  position: relative;
  .titile-box {
    width: 260px;
    height: 42px;
    background: url(https://static.jiyi.show/free/style16/Showcase2TitleBg.webp) no-repeat center /
      cover;
    padding: 4px 13px;
    position: absolute;
    top: 96px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    p {
      // width: 16px;
      // width: 100%;
      width: 100%;
      color: #333;
      line-height: 32px;
      font-size: 18px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      font-family: SourceHanSerifCN;
      text-align: center;
    }
  }

  .Showcase1-top-left {
    width: 110px;
    height: 100%;
  }
  .Showcase1-top-center {
    flex: 1;
    min-width: 180px;
    height: 100%;
  }
  .Showcase1-top-right {
    width: 110px;
    height: 100%;
  }
}
.Showcase1-btm {
  width: 100%;
  height: 100%;
  min-height: 162px;
  display: flex;
  background: #4b4f45;
  .Showcase1-btm-left {
    width: 110px;
    height: 100%;
    flex-shrink: 0;
  }
  .Showcase1-btm-center {
    width: 100%;
    min-width: 180px;
    height: 100%;
  }
  .Showcase1-btm-right {
    width: 110px;
    height: 100%;
    flex-shrink: 0;
  }
}
</style>